---
category: Level 1 — Basic
created: '2020-02-16'
keywords:
title: Get the text content of an element
---

Returns the raw text content of the `ele` element and its children. All the HTML tags are excluded.

```js
const text = ele.textContent;
```

## See also

-   [Export a table to csv](https://phuoc.ng/collection/html-dom/export-a-table-to-csv/)
-   [Get or set the html of an element](https://phuoc.ng/collection/html-dom/get-or-set-the-html-of-an-element/)
-   [Scale a text to fit inside of an element](https://phuoc.ng/collection/html-dom/scale-a-text-to-fit-inside-of-an-element/)
-   [Strip html from a given text](https://phuoc.ng/collection/html-dom/strip-html-from-a-given-text/)
